#!/usr/bin/env python

import numpy as np
import sys

if len(sys.argv) != 4:
  print "usage: %s <%s> <%s> <%s>"%('sys.argv[0]', 'abs coord file','width','height')
  exit(-1)
  
  
inputFile=sys.argv[1]
width=sys.argv[2]
height=sys.argv[3]
x, y = np.loadtxt(inputFile, unpack=True, delimiter=',')

print "for mathematica:"
for _x,_y in zip(x,y):
  print "{%8.5f, %8.5f},"%(_x,_y)
x /= int(width)
y /= int(height)

print "convert to relative numbers:"
for _x,_y in zip(x,y):
  print "%8.5f, %8.5f"%(_x,_y)

